const { DataTypes, Model } = require('sequelize');
const sequelize = require('../db/index.js');
class Video extends Model {}


Video.init({
    filename: {
        type: DataTypes.STRING,
        allowNull: false,
    },
    status: {
        type: DataTypes.ENUM('enabled', 'disabled'),
        allowNull: false,
        defaultValue: 'enabled',
    },
}, {
    sequelize,
    timestamps: true,
    createdAt: 'created_at',
    updatedAt: 'updated_at',
    deletedAt: 'deleted_at',
    paranoid: true,
    defaultScope: {
        order: [['created_at', 'DESC']], // 设置默认排序
    },
});

module.exports = Video;